# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1alpha1QueryMetricsResponseSliceDataPointConversationMeasure do
  @moduledoc """
  The measure related to conversations.

  ## Attributes

  *   `averageAgentSentimentScore` (*type:* `number()`, *default:* `nil`) - The average agent's sentiment score.
  *   `averageClientSentimentScore` (*type:* `number()`, *default:* `nil`) - The average client's sentiment score.
  *   `averageCustomerSatisfactionRating` (*type:* `float()`, *default:* `nil`) - The average customer satisfaction rating.
  *   `averageDuration` (*type:* `String.t`, *default:* `nil`) - The average duration.
  *   `averageQaNormalizedScore` (*type:* `float()`, *default:* `nil`) - Average QA normalized score. Will exclude 0's in average calculation.
  *   `averageQaQuestionNormalizedScore` (*type:* `float()`, *default:* `nil`) - Average QA normalized score averaged for questions averaged across all revisions of the parent scorecard. Will be only populated if the request specifies a dimension of QA_QUESTION_ID.
  *   `averageSilencePercentage` (*type:* `number()`, *default:* `nil`) - The average silence percentage.
  *   `averageTurnCount` (*type:* `number()`, *default:* `nil`) - The average turn count.
  *   `conversationCount` (*type:* `integer()`, *default:* `nil`) - The conversation count.
  *   `qaTagScores` (*type:* `list(GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1alpha1QueryMetricsResponseSliceDataPointConversationMeasureQaTagScore.t)`, *default:* `nil`) - Average QA normalized score for all the tags.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :averageAgentSentimentScore => number() | nil,
          :averageClientSentimentScore => number() | nil,
          :averageCustomerSatisfactionRating => float() | nil,
          :averageDuration => String.t() | nil,
          :averageQaNormalizedScore => float() | nil,
          :averageQaQuestionNormalizedScore => float() | nil,
          :averageSilencePercentage => number() | nil,
          :averageTurnCount => number() | nil,
          :conversationCount => integer() | nil,
          :qaTagScores =>
            list(
              GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1alpha1QueryMetricsResponseSliceDataPointConversationMeasureQaTagScore.t()
            )
            | nil
        }

  field(:averageAgentSentimentScore)
  field(:averageClientSentimentScore)
  field(:averageCustomerSatisfactionRating)
  field(:averageDuration)
  field(:averageQaNormalizedScore)
  field(:averageQaQuestionNormalizedScore)
  field(:averageSilencePercentage)
  field(:averageTurnCount)
  field(:conversationCount)

  field(:qaTagScores,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1alpha1QueryMetricsResponseSliceDataPointConversationMeasureQaTagScore,
    type: :list
  )
end

defimpl Poison.Decoder,
  for:
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1alpha1QueryMetricsResponseSliceDataPointConversationMeasure do
  def decode(value, options) do
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1alpha1QueryMetricsResponseSliceDataPointConversationMeasure.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1alpha1QueryMetricsResponseSliceDataPointConversationMeasure do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
